home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 4,401 to 4,500 / aol-file-protocol-4400-4401-to-4500.zip / AOLDLs / PDA-Newton Development / ND SciCalc (source) / Calcsource.sit / Calc source / source readme < prev    next >
Text File  |  1994-11-13  |  3KB  |  29 lines

  1. About SciCalc - the first scientific calculator for the Apple Newton¬
  2. Version 1.0b3 - source code version
  3.  
  4. Following many calls for the posting of source code, I am making this early version of my little scientific calculator available.  These are a few random jottings to explain why I did some of the extraordinary things which I have done, and hopefully to make up for the complete lack of comments.
  5.  
  6. When I first started this, I was tempted to use one of the keyboard objects as a prototype.  I was deterred partly by the difficulty in trying to get them to work, but largely because they prevented me from using the easy visual design of the interface which the NTK excels in.  It has since proved a good decision, as it has been much easier to tweak and tune the layout as things have progressed.  Maybe in future NTK releases, this will be different.
  7.  
  8. The way in which the calculator works centres on the result view, which contains two numeric slots (containing the last and last but one numbers as floats), the text displayed in the view, and various other slots and methods to make it all work.  When you click on a number key, it simply appends that digit to the displayed string, etc.  When you click on a function key, then an appropriate script is called to execute that function.
  9.  
  10. My ploy to make this easy to program is to use the compile() function.  Thus, the basic evaluation engine builds a string to compile(), compile()s it, and then displays the result.
  11.  
  12. There are two main problems with this approach:
  13.  
  14. first, the string and float conversion routines prettify the strings, which the compile() function barfs at - feed it a string containing thousand-marking commas, or in exponential form, and it gets upset.  So, currently numeric strings are processed to strip out the commas;
  15.  
  16. second, although the system exception handling is not bad, it does not trap SANE errors, does not give particularly informative messages, and does not return properly.  So, thanks to Kent Sandvik of PIE DTS, I have just built in a simple exception handler.
  17.  
  18. None of this code is clever, good, or in good style.  However, I hope it is a help to you.
  19.  
  20. This source code is freely distributable, and must not be sold.  However, it remains Copyright ⌐ 1993 EHN & DIJ Oakley, all other rights reserved.  It was developed using the Newton Toolkit, which is Copyright ⌐ 1992-1993 Apple Computer, Inc., all rights reserved.  Apple Computer, Inc., accepts no liability or responsibility whatsoever for this product, and so on.  As this is supplied free, EHN & DIJ Oakley accept no responsibility or liability for the product or what it might do to your Newton, nor for any inaccuracy of any results therefrom.  You use it entirely at your own risk!  Newton and most other trade names mentioned above are registered trademarks of Apple Computer, Inc.
  21.  
  22. If you do (amazingly) find a use for any of the code within this, please feel welcome to drop me a little credit somewhere - and/or even better, please send me a copy of your product, to:
  23. EHN & DIJ Oakley, Brooklands Lodge, Park View Close, Wroxall, Ventnor, Isle of Wight PO38 3EQ, UK.
  24.  
  25. Howard Oakley, EHN & DIJ Oakley.
  26. CompuServe 70734,120; AppleLink UK0392; Internet Howard@quercus.demon.co.uk;
  27. Fax +44 983 853253.
  28. More fine software from the Isle of Wight, UK!
  29.